package com.neil.dynamic.gateway;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.client.discovery.EnableDiscoveryClient;
import org.springframework.cloud.client.loadbalancer.LoadBalanced;
import org.springframework.context.annotation.Bean;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.web.client.RestTemplate;

/**
 *  动态网关启动类
 * @ProjectName:
 * @Package:        com.neil.dynamic.gateway
 * @ClassName:      GatewayDynamicRouteApplication
 * @Description:    动态网关启动类
 * @Author:         Neil.Zhou
 * @CreateDate:     2019/10/14 16:22
 * @UpdateUser:     Neil.Zhou
 * @UpdateDate:     2019/10/14 16:22
 * @UpdateRemark:   The modified content
 * @Version:        1.0
 * <p>Copyright: Copyright (c) 2019/10/14</p>
 *
 */
@EnableScheduling
@EnableDiscoveryClient
@SpringBootApplication
public class GatewayDynamicRouteApplication {

	public static void main(String[] args) {
		SpringApplication.run(GatewayDynamicRouteApplication.class, args);
	}


	/**
	 * 启动Rest模板请求对象
	 * @return
	 */
	@Bean
	@LoadBalanced
	public RestTemplate restTemplate(){
		return new RestTemplate();
	}
}

